###
	@Autor: Daniel Ortega
	@Autor_URI: gatero.mx
###

class plugin extends view
	constructor:->
		if $.validity then @alert = $.validity.messages
	validity:(target)->
		x= @
		target= if target? then target else 'form'
		# config
		$(target).validity ->
			$('[data-require]').require()
			$('[data-require="fecha"]').match 'date'
			$('[data-require="email"]').match 'email'
			$('[data-require="number"]').match 'number'
			$('[data-require="pass"]').equal x.alert.equal